Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add branches support to update_plugin.sh #299

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

illia-shkroba
Copy link

@illia-shkroba illia-shkroba commented Nov 2, 2024

Encountered problem

Recently I've encountered an issue with https://github.com/catppuccin/tmux/tree/main plugin. The most recent release was not backwards compatible (major version update), and because of that my config was no longer working, although I was happy with how it had looked like.

The catppuccin plugin was added to my tmux.conf like this:

set-option -g @plugin 'catppuccin/tmux'

Since there was no tag specified like 'catppuccin/tmux#v0.3', the update_plugins all fetches the most recent version from origin/HEAD -- which is to be expected. What I hadn't expected, was that when I had fixed my config by adding the tag:

set-option -g @plugin 'catppuccin/tmux#v0.3'

restarted tmux, and run update_plugins all again, the catppuccin/tmux repository still had the main branch (the one that was configured with origin/HEAD) checked out. Only when I had removed the plugin entirely and then brought it back with the appropriate version, the problem was solved.

When user changes the version in the config it is not used by the update_plugins. It means that in order to change the version, the user has to remove the plugin entirely and then reinstall it.

Cause

The issue was that scripts/update_plugin.sh ignores branches/tags/commits set in the config.

Fix

I have fixed the described issue in this PR. Could you please kindly take a look? Any suggestions and comments are highly appreciated.

I haven't contributed to the tpm project yet, so I understand that the changes that I've made might not follow the used coding style (although, I did my best to make sure they do). In case you find the code style to be incompatible, please kindly let me know.

Git version

The fix was tested with the following git versions:

  • 2.43.0
  • 2.47.0

@illia-shkroba illia-shkroba force-pushed the master branch 2 times, most recently from fcbf121 to 867951b Compare November 3, 2024 11:35
@illia-shkroba illia-shkroba marked this pull request as draft November 3, 2024 11:38
@illia-shkroba illia-shkroba changed the title Add branches support to update_plugin.sh (proper version) Add branches support to update_plugin.sh Nov 3, 2024
@illia-shkroba illia-shkroba marked this pull request as ready for review November 3, 2024 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant